package com.taotao.job.core.trigger;

import com.taotao.job.core.model.JobMeta;
import com.taotao.job.core.trigger.context.TriggerFeature;

/**
 * 触发器,负责单个任务的触发逻辑
 *
 * @author fanbeibei
 * @version 1.0
 * @date 2021/2/4 14:09
 */
public interface Trigger {

    /**
     * 触发任务，获取触发结果
     *
     * @return
     */
    TriggerResult trigger(JobMeta jobMeta, TriggerFeature triggerFeature, long shouldTriggerTime);


    /**
     * 手动触发任务
     *
     * @param jobId         任务ID
     * @param executorParam 任务执行参数
     * @param runPost       是否拉起后续的任务
     * @return
     */
    TriggerResult manualTrigger(Long jobId, String executorParam, boolean runPost);


}
